/**
 * @require /static/widege/admin/popup/popup.js
 */
(function($) {
    var $textBtn,
        $rightGlobal = $('.rightContent'),
        $textarea = '<div class="textareaDiv brick canMove"  data-module="textarea"><textarea class="rightTextStyle">文本信息文本信息</textarea></div>';

    var $listBtn,
        // $elseBox = $('<div class="gridly elseBox"></div>');
        $list = '<ul class="rightTextList canMove brick"  data-module="list"><li>内容1内容1内容1</li><li>内容2内容2内容2</li><li>内容3内容3内容3</li><li>内容4内容4内容4</li><li>内容5内容5内容5</li></ul>';

    var index = {
        init: function() {
            $textBtn = $("#textBtn");
            $listBtn = $("#listBtn");
            this.bindEvent();
        },
        bindEvent: function() {
            $textBtn.on("click", function(e) {
                $(".rightContent").append($textarea);
                $.communication($.leftMenu);
                $('.gridly').gridly();
                $(".rightTextStyle").on("dblclick", function(e) {
                    $(e.target).css({
                        "border-color": "#A9A9A9",
                        "resize": "both",
                        "overflow": "auto"
                    });
                });
                $(".rightTextStyle").on("blur", function(e) {
                    $(e.target).css({
                        "border-color": "transparent",
                        "resize": "none",
                        "overflow": "hidden"
                    });
                });
            });
            $listBtn.on("click", function(e) {
                $(".rightContent").append($list);
                $('.gridly').gridly();
                $.communication($.leftMenu);
            });
        }
    };
    return $.PMS.dMenuMssageElse = {
        index: index
    };
})(jQuery);